_=document||window.document;
log=console.log||window.console.log||null;
window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame;
function lsg(key) {
    log("read "+key+":"+localStorage.getItem(key));
    return localStorage.getItem(key);
}
function lss(key,value) {
    log("set "+key+":"+value);
    return localStorage.setItem(key,value);
}
var tag={
    a:function () {
        return $("<a></a>").css("display","inline-block");
    },
    div:function () {
        return $("<div></div>");
    },
    input:function input(type,value) {
        return $("<input type='"+type+"' value='"+value+"'>");
    },
    span:function () {
        return $("<span></span>");
    },
    canvas:function () {
        return $("<canvas></canvas>");
    },
    script:function (src) {
        return $("<script src='"+src+"'></script>");
    },
    ul:function () {
        return $("<ul></ul>");
    },
    ol:function () {
        return $("<ol></ol>")
    },
    li:function () {
        return $("<li></li>")
    }
};
$.prototype.mst=function (str) {
    function reckonVal(pro) {
        pro.substr(-1)!=="%"&pro.substr(-2)!=="px"&&(pro=pro+"px");
        return pro;
    }
    str=str.split(" ");
    for(var x in str){
        if(str.hasOwnProperty(x)){
            str[x]=str[x].replace(/&nbsp;/g," ");
            var c=str[x].substr(1);
            var d=str[x].substr(2);
            var e=str[x].substr(3);
            switch (str[x]){
                case "fl":
                    this.css("float","left");
                    continue;
                case "fr":
                    this.css("float","right");
                    continue;
                case "ofh":
                    this.css("overflow","hidden");
                    continue;
                case "bpc":
                    this.css("background-position","center");
                    continue;
                case "poa":
                    this.css("position","absolute");
                    continue;
                case "pof":
                    this.css("position","fixed");
                    continue;
                case "por":
                    this.css("position","relative");
                    continue;
                case "dib":
                    this.css("display","inline-block");
                    continue;
                case "dpb":
                    this.css("display","block");
                    continue;
                case "dpn":
                    this.css("display","none");
                    continue;
                case "cup":
                    this.css("cursor","pointer");
                    continue;
                case "m0a":
                    this.css({
                        "margin-top":"0",
                        "margin-bottom":"0",
                        "margin-left":"auto",
                        "margin-right":"auto"
                    });
                    continue;
                case "bgrn":
                    this.css("background-repeat","no-repeat");
                    continue;
            }
            switch (str[x].substr(0,3)){
                case "bgi":
                    this.css("background-image",e);
                    continue;
                case "bgc":
                    this.css("background-color",e);
                    continue;
                case "bgs":
                    this.css("background-size",e);
                    continue;
                case "bdr":
                    this.css("border-radius",reckonVal(e));
                    continue;
                case "maw":
                    this.css("max-width",reckonVal(e));
                    continue;
                case "mah":
                    this.css("max-height",reckonVal(e));
                    continue;
                case "miw":
                    this.css("min-width",reckonVal(e));
                    continue;
                case "mih":
                    this.css("min-height",reckonVal(e));
                    continue;
            }
            switch (str[x].substr(0,2)){
                case "tr":
                    this.css("transition",d+"ms");
                    continue;
                case "lh":
                    this.css("line-height",reckonVal(d));
                    continue;
                    case "bd":
                    this.css("border",d);
                    continue;
                case "bg":
                    this.css("background",d);
                    continue;
                case "fz":
                    this.css("font-size",d);
                    continue;
                case "mt":
                    this.css("margin-top",reckonVal(d));
                    continue;
                case "mb":
                    this.css("margin-bottom",reckonVal(d));
                    continue;
                case "ml":
                    this.css("margin-left",reckonVal(d));
                    continue;
                case "mr":
                    this.css("margin-right",reckonVal(d));
                    continue;
                case "pt":
                    this.css("padding-top",reckonVal(d));
                    continue;
                case "pb":
                    this.css("padding-bottom",reckonVal(d));
                    continue;
                case "pl":
                    this.css("padding-left",reckonVal(d));
                    continue;
                case "pr":
                    this.css("padding-right",reckonVal(d));
                    continue;
            }
            switch (str[x].substr(0,1)){
                case "w":
                    this.css("width",reckonVal(c));
                    continue;
                case "h":
                    this.css("height",reckonVal(c));
                    continue;
                case "t":
                    this.css("top",reckonVal(c));
                    continue;
                case "b":
                    this.css("bottom",reckonVal(c));
                    continue;
                case "l":
                    this.css("left",reckonVal(c));
                    continue;
                case "r":
                    this.css("right",reckonVal(c));
                    continue;
                case "m":
                    this.css("margin",reckonVal(c));
                    continue;
                case "c":
                    this.css("color",c);
                    continue;
                case "p":
                    this.css("padding",reckonVal(c));
            }
        }
    }
    return $(this);
};
